//
//  MacroDefinition.h
//  Community
//
//  Created by LiTengFei on 14/12/11.
//  Copyright (c) 2014年 HangZhou PiaoYoung Co.Ltd. All rights reserved.
//

#ifndef Community_MacroDefinition_h
#define Community_MacroDefinition_h

#define kTabbarHeight 64
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

#ifdef DEBUG

#undef DEBUG

#define DEBUG 1
#define DEBUG_NET 0

#endif


//重写NSLog,Debug模式下打印日志和当前行数

#define BUG(FORMAT, ...) fprintf(stderr ,    "\n\n"\
                                            "-----------------------------------------------------\n" \
                                            "     function:%s  \n" \
                                            "     line:%d \n"      \
                                            "     file:%s \n"      \
                                            "     date:%s \n"      \
                                            "-----------------------------------------------------\n" \
                                            "content  :  %s\n\n\n" \
                                            , __FUNCTION__ , __LINE__ ,  __FILE__ , __DATE__,[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);


#if DEBUG

#else
#define NSLog(FORMAT, ...)
#endif

#define SCREEM_SIZE  [[UIScreen mainScreen] currentMode].size

#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960),SCREEM_SIZE): NO)
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136),SCREEM_SIZE): NO)
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)]? CGSizeEqualToSize(CGSizeMake(750, 1334),SCREEM_SIZE): NO)
#define iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1080, 1920),SCREEM_SIZE): NO)

#endif
